package com.fuxin.hanfu.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

@RestController
public class TestController {
    //RequestMapping能接受get和post请求
    @RequestMapping("/hello")
    public String hello(){
        return "hello";
    }


    //接受get请求
    @GetMapping("/helloGet")
    public String helloGet(){
        return "Hello World!";
    }
    //将自定义配置引入给到testHello
    @Value("HelloSpring")
    private String testHello;
    //传参的方式写get请求
    @RequestMapping( value = "/helloGet2",method = RequestMethod.GET)
    public String helloGet2(){
        return "Hello World!"+testHello;
    }

    //接受post请求
    @PostMapping("/helloPost")
    public String helloPost(String name){
        return "hello Post!"+name;
    }



}
